import logging
import yagmail

def log(filename,filemode):
    log=logging.basicConfig(level=logging.INFO,format='%(filename)s %(asctime)s %(message)s',
                            filename=filename,
                            filemode=filemode)
    return log

def set_mail(subject,filename):
    send=yagmail.SMTP(user='chenzw3013@qq.com',password='yzkuylhvhxvudacd',host='smtp.qq.com')
    send.send(to='chenzw3013@qq.com',subject=subject,contents='请查收',attachments=filename)
    print('发送成功！')